package com.ycy.ss.tumblr.po;

import java.util.List;

public class TumblrPostPhotos extends TumblrPostBase{
	private String caption; // The user-supplied caption

	private List<TumblrPostPhotosPhoto> photos;

	// Photo objects with properties:
	// caption – string: user supplied caption for the individual photo (Photosets only)
	// alt_sizes – array: alternate photo sizes, each with:
	// width – number: width of the photo, in pixels
	// height – number: height of the photo, in pixels
	// url – string: Location of the photo file (either a JPG, GIF, or PNG)

	// new add
	private String link_url;

	public String getLink_url(){
		return link_url;
	}

	public void setLink_url(String linkUrl){
		link_url = linkUrl;
	}

	public String getCaption(){
		return caption;
	}

	public void setCaption(String caption){
		this.caption = caption;
	}

	public List<TumblrPostPhotosPhoto> getPhotos(){
		return photos;
	}

	public void setPhotos(List<TumblrPostPhotosPhoto> photos){
		this.photos = photos;
	}

	public String getFirstPhotoUrl(){
		if (this.photos != null && this.photos.size() != 0) {
			List<TumblrPostPhotosPhotoAltSize> alt_sizes = this.photos.get(0).getAlt_sizes();
			if (alt_sizes != null && alt_sizes.size() != 0) {
				return alt_sizes.get(0).getUrl();
			}
		}
		
		return null;
	}

}
